<?php
/**
 * Netflix_Review Class.
 *
 * @author Armando Padilla, armando_padilla_81@yahoo.com
 * @package Zend_Service_Netflix
 */
require_once "Title.php";

class Netflix_Review {

	/**
	 * Actual review writen by the user.
	 *
	 * @var String $writeUp
	 */
	public $writeUp;
	
	/**
	 * Date review was updated.
	 *
	 * @var String $updatedDate.
	 */
	public $updatedDate;
	
	/**
	 * User's Rating of title.
	 *
	 * @var int $userRating
	 */
	public $userRating;
	
	/**
	 * Helpful. Number of votes indicating
	 * the review was helpful.
	 *
	 * @var int $helpful
	 */
	public $helpful;
	
	/**
	 * Not Helpful. Number of votes indicating
	 * the review was NOT helpful.
	 *
	 * @var int $notHelpful
	 */
	public $notHelpful;
	
	/**
	 * Review Id.
	 *
	 * @var int $reviewId
	 */
	public $id;
	
	
	/*******************
	 * SHOULD WE RETURN A NETFLIX_TITLE OBJECT?? (this will make it tightly coupled...not cool)
	 * OR SHOULD I JUST RETURN THE TITLE OF THE ITEM
	 * AND ALLOW THE USER TO QUERY THE TITLE INFO ON THEIR OWN?
	 ********************/	
	public $title;

	
	public function __construct(){
		
		//Intantiate new Netflix_Title object
		$this->title = new Netflix_Title();
		
	}
	
	
	/**
	 * Load data from XML.
	 * 
	 * @param SimpleXMLElement $simpleXMLObject
	 */
	public function loadXML(SimpleXMLElement $simpleXMLObject){
		
		//Set property information.
		$this->writeUp 	  = (string)$simpleXMLObject->write-up;
		$this->updated 	  = (string)$simpleXMLObject->updated;
		$this->userRating = (string)$simpleXMLObject->user_rating;
		$this->helpful    = (string)$simpleXMLObject->not_helpful;
		$this->reviewId   = (string)$simpleXMLObject->review_id;
		$this->title      = (string)$simpleXMLObject->title['regular'];
		
	}

	
}
?>